]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Disable favorite shortcuts without overview
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 29 May 2019 15:20:23 +0000 (17:20 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 29 May 2019 20:03:59 +0000 (20:03 +0000)
The `switch-to-application-n` shortcuts are essentially "launch the nth
app in the dash" actions, so they are at the very least confusing when
the dash isn't available because the overview itself is disabled (for
example in initial-setup mode).

So disable the shortcuts when the overview is disabled, but delegate the
decision to a separate function so that extensions like 'panel-favorites'
which expose favorites by some other means can easily re-enable them.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1333

js/ui/windowManager.js

index 1ab99fcdd23a51cf1e30aaff42af35a89f5b6ddf..1d94e15833f4a4551d73264b7146c22a6194cce4 100644 (file)
@@ -2121,7 +2121,14 @@ var WindowManager = class {
         Main.ctrlAltTabManager.popup(binding.is_reversed(), binding.get_name(), binding.get_mask());
     }
 
+    _allowFavoriteShortcuts() {
+        return Main.sessionMode.hasOverview;
+    }
+
     _switchToApplication(display, window, binding) {
+        if (!this._allowFavoriteShortcuts())
+            return;
+
         let [,,,target] = binding.get_name().split('-');
         let apps = AppFavorites.getAppFavorites().getFavorites();
         let app = apps[target - 1];